<!--交易记录-->

<template>
	<div>
		<div class="my_header">
			<i class="mui-icon mui-icon-arrowleft" aria-hidden="true" @click="$router.back(-1)"></i>
			<div class="top1">交易详情</div>

		</div>
		<div class="jyrecord">

			<div class="row">
				<div class="left">交易时间</div>
				<div class="right" v-text="jyrecorddetail.add_time"></div>
			</div>
			<div class="row">
				<div class="left">交易类型</div>
				<div class="right" v-text="jyrecorddetail.type"></div>
			</div>
			<div class="row">
				<div class="left">流水号</div>
				<div class="right" v-text="jyrecorddetail.type"></div>
			</div>
			<div class="row">
				<div class="left">交易金额</div>
				<div class="right" :class="jyrecorddetail.status=='-'?'blue':'red'">{{jyrecorddetail.status}}￥{{jyrecorddetail.money}}</div>
			</div>
			<div class="row">
				<div class="left">账户余额</div>
				<div class="right">￥{{jyrecorddetail.wallet}}</div>
			</div>
			<div class="row">
				<div class="left">交易结果</div>
				<div class="right">已到账</div>
			</div>
		</div>

	</div>

</template>

<script>
	export default {

		data() {
			return {

				jyrecorddetail: {},

			};
		},
		created: function() {
			var token = localStorage.getItem("token");
			var that = this;
			var jyid = this.$route.query.tabitem;
			that.getjydetail(jyid);
		},
		methods: {
			

			getjydetail(jyid) {
				console.log(jyid);
				var that = this;
				
				$.ajax({
					type: "get",
					url: "http://zcapi.hrgsxt.cn/api/User_account/transaction_info",
					data: {
						token: localStorage.getItem("token"),
						transaction_id: jyid
					},
					cache: false,
					dataType: "json",
					success: function(data) {
						
						if(data.code == 200) {

							that.jyrecorddetail = data.data;

							console.log(JSON.stringify(that.jyrecorddetail));

						} else {

							that.$toast({
								message: data.message,
								duration: 1000
							})

						}

					}
				});
			}

		},

		watch: {
			// 如果路由有变化，会再次执行该方法
			'$route': 'fetchData'
		}
	}

	//图片上传并预览
</script>

<style scoped>
		.red{
		color: #FF7E00 !important;
	}
	.blue{
		color:#0085F0 !important;
	}
	/*头部*/
	
	.my_header {
		height: .88rem;
		background: rgba(0, 133, 240, 1);
		text-align: center;
		color: #fff;
		line-height: .88rem;
		position: relative;
		padding: 0 .3rem;
	}
	
	.jyje .right {
		color: #FF7E00 !important;
	}
	
	.my_header i {
		font-size: .4rem;
		float: left;
		line-height: .88rem;
	}
	
	.my_header .top1 {
		width: 40%;
		margin-left: 25%;
		float: left;
		text-align: center;
	}
	/*查询记录*/
	
	.jyrecord {
		margin-top: 0px !important;
		width: 100%;
		font-size: 0.26rem !important;
		background-color: #FFFFFF;
	}
	
	.jyrecord .row {
		width: 100%;
		height: 0.88rem;
		background-color: #FFFFFF;
		line-height: 0.88rem;
		padding: 0px 0.3rem 0px 0.3rem;
		border-bottom: 1px solid #efefef;
	}
	
	.jyrecord .row:first-child {
		border-bottom: 1px solid #efefef;
	}
	
	.jyrecord .row .left {
		width: 50%;
		float: left;
		font-size: 0.3rem;
		color: #333333;
	}
	
	.jyrecord .row .right {
		color: #666666;
		width: 50%;
		float: right;
		font-size: 0.28rem;
		line-height: 0.88rem;
		text-align: right;
	}
	
	.jyrecord .row .right img {
		width: 0.14rem;
		height: 0.24rem;
		vertical-align: middle;
		margin-left: 7px;
		margin-bottom: 3px;
	}
	
	.jyrecord .row .right input {
		border: none;
		outline: none;
		text-indent: 4em;
		text-align: right;
		padding-right: 0px !important;
	}
</style>